﻿<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<%@page import="manage.BugManage"%>
<%@ page  import="java.util.*"  %>
<%@ page  import="java.sql.*"  %>
<%@page import="object.Module"%>
<%@page import="object.Bug"%>
<%@page import="manage.FileManage"%>
<%@page import="object.File"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ include file="JS/session.jsp" %>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>显示bug信息</title>
<link href="css/foreground.css" rel="stylesheet" type="text/css" />
</head>
 <BODY id=css-zen-garden >
<DIV id=container>
<DIV id=intro>
<DIV id=quickSummary>
<p class=p2>欢迎，<%=session.getAttribute("RealName") %>;<a href="login.jsp">退出</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="EditUser.jsp">修改资料</a>&nbsp;&nbsp;
    <%
     String level= null;
     level=(String)session.getAttribute("UserLevel");
     if(level!=null&&level.equals("0"))
     {
     %> 
      <a href="admin/AddGroup.jsp">进入后台</a>
      <%
       }
       %></p>
</DIV>
<DIV id=buginfo>
<H3><SPAN>BUG信息</SPAN></H3>
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="table_style">
 <%
     String ID=request.getParameter("BugID");
     if(ID!=null)
     {
      int BugID=Integer.parseInt(ID);
      Bug bug=BugManage.getBug(BugID);
      
 
%>
  <tr bgcolor="#52514E">
    <td width="100">&nbsp;Bug标题</td>
    <td colspan="3" align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=bug.getBugTitle()%></td>
  </tr>
  <tr bgcolor="#52514E">
    <td colspan="4">&nbsp;<%=bug.getProjectName() %>/<%=bug.getModuleName() %></td>
  </tr>
  <tr bgcolor="#52514E">
    <td width=100 colspan="2" align="center" class="word">Bug状态</td>
    <td colspan="2" align="center" class="word">创建</td>
    </tr>
  <tr bgcolor="#52514E">
    <td>类型</td>
    <td><%=bug.getBugType() %></td>
    <td width="25%">由谁创建</td>
    <td><%=bug.getOpenedByByName() %></td>
  </tr>
  <tr bgcolor="#52514E">
    <td>操作系统</td>
    <td><%= bug.getBugOS() %>;</td>
    <td>创建日期</td>
    <td><%=bug.getOpenedDate() %></td>
  </tr>
  <tr bgcolor="#52514E">
    <td>严重程度</td>
    <td><%=bug.getBugSeverity() %></td>
    
    <td>创建Build</td>
    <td><%= bug.getOpenedBuild() %></td>
  </tr>
  <tr bgcolor="#52514E">
    <td>优先级<br /></td>
    <td><%= bug.getBugPriority() %></td>
    <td colspan="2" align="center" class="word">解决</td>
    </tr>
  <tr bgcolor="#52514E">
    <td>状态</td>
    <td><%= bug.getBugStatus() %></td>
    <td>由谁解决</td>
    <td><%= bug.getResolvedByName() %></td>
  </tr>
  <tr bgcolor="#52514E">
    <td rowspan="3">指派给</td>
    <td rowspan="3"><%= bug.getAssignedToName() %></td>
    <td>解决日期</td>
    <td><%=bug.getResolvedDate() %></td>
  </tr>
  <tr bgcolor="#52514E">
    <td>解决Build</td>
    <td><%=bug.getResolvedBuild() %></td>
  </tr>
  <tr bgcolor="#52514E">
    <td>解决方案</td>
    <td><%=bug.getResolution() %></td>
  </tr>
  <tr bgcolor="#52514E">
    <td colspan="2" align="center" class="word">发信通知</td>
    <td colspan="2" align="center" class="word">关闭</td>
  </tr>
  <tr bgcolor="#52514E">
    <td colspan="2" align="center"><%= bug.getMailTo() %></td>
    
    <td>由谁关闭</td>
    <td><%= bug.getClosedByName() %></td>
  </tr>
  <tr bgcolor="#52514E">
    <td align="center">附件</td>
    <td>&nbsp;</td>
    <td>关闭日期</td>
    <td><%=bug.getClosedDate() %></td>
  </tr>
   <tr bgcolor="#52514E">
   <td colspan="2" align="center">
  <%
    ArrayList list=FileManage.getFileList(bug.getBugID());
    if(list.size()>0)
   {
     for(int i=0;i<list.size();i++)
     {
       File file=(File)list.get(i);
       String FileTitle=file.getFileTitle();
       String FileName=file.getFileName();
   %>
 
    <a href="JS/downLoad.jsp?filename=UpLoadFile/<%= file.getFileName() %>"><%= FileTitle %></a>
     
    <%
   }
   }
   %>   </td>
   
      
      
    <td colspan="2" align="center" class="word">相关Bug</td>
    </tr>
  <tr bgcolor="#52514E">
    <td colspan="2">&nbsp;</td>
    <td colspan="2" align="center"><%=bug.getLinkID() %></td>
    </tr>
  <tr bgcolor="#52514E">
    <td colspan="4" align="center" class="word">动作</td>
    </tr>
  <tr bgcolor="#52514E">
  <script language="javascript">

 <!--
  
 onload= function()
  {
    <%
     String bugstatus=null;
     bugstatus=bug.getBugStatus();
     if(bugstatus.equals("Active"))
      {
      
       %>
        document.getElementById("closed").disabled=true;
        document.getElementById("reactived").disabled=true;
       <%
       
      }
      
      else
          if(bugstatus.equals("Resolved"))
          {
           %>
             document.getElementById("resolved").disabled=true;
             
           <%
          }
          else
          if(bugstatus.equals("Closed"))
          {
          %>
            document.getElementById("resolved").disabled=true;
            document.getElementById("closed").disabled=true;
          <%
          }
    %>
   
  }
  

</script>
  
    <td colspan="4" align="center"> <input name="submit" type="button" value="编辑" onclick="location.href='EditBug.jsp?BugID=<%=bug.getBugID()%>'" />&nbsp;&nbsp;&nbsp;  
    <input name="resolved" id=resolved  type="button" value="解决"  onclick="location.href='ResolvedBug.jsp?BugID=<%=bug.getBugID()%>'" />&nbsp;&nbsp; 
    <input name="closed" id=closed type="button" value="关闭" onclick="location.href='ClosedBug.jsp?BugID=<%=bug.getBugID()%>'" />&nbsp;&nbsp; 
    <input name="reactived" id=reactived type="button" value="激活" onclick="location.href='ActivatedBug.jsp?BugID=<%=bug.getBugID()%>'" />&nbsp;&nbsp;  
   <input name="submit"     type="button" value="返回列表" onclick="location.href='QueryBug.jsp?QueryMode=Whole'" /> </td></tr>
</table>
<%} %>
</DIV>
</DIV>
<DIV id=supportingText></DIV>
<DIV id=linkList>
<DIV id=linkList2>
<DIV id=lselect>
<H3 class=select></H3>
<UL>
 <li><a href="QueryBug.jsp?QueryMode=Whole"><span 
  class=accesskey>查看BUG</span></a> </li>
 <li><a href="AddBug.jsp"><span 
  class=accesskey>创建BUG</span></a> </li>
  </UL>
</DIV>
<DIV id=larchives>
<H3 class=archives><SPAN></SPAN></H3>
<UL>
        <LI>
        <form id="form1" name="form1" method="post" action="">
          <select name="select2" class="treelist" id="select2">
            <option selected="selected">维护项目</option>
          </select>
        </form>
      </LI>
</UL></DIV>
<DIV id=lresources>
<H3 class=resources></H3>
<UL>
 <li><a href="QueryBug.jsp?QueryMode=AssignedTo"><span class=accesskey>指派给我的BUG</span></a> </li>
 <li><a href="QueryBug.jsp?QueryMode=Opened"><span class=accesskey>由我创建的BUG</span></a> </li>
  </UL>
</DIV></DIV></DIV></DIV></BODY>
</html>